﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace BusinessPlatform.Core.BusinessObject.Properties
{
    /// <summary>
    /// 属性管理器
    /// </summary>
    internal interface IPropertiesManager : IDictionary<String, IPropertyInfo>
    {
        /// <summary>
        /// 注册类里所有的属性
        /// </summary>
        /// <param name="objType"></param>
        void RegisterProperties(IBusinessObjectBase EntityBase);
        /// <summary>
        /// 获取属性值
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="PropertyName"></param>
        /// <returns></returns>
        T GetPropertyValue<T>(string PropertyName);
        /// <summary>
        /// 设置属性值
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="PropertyName"></param>
        /// <returns></returns>
        void SetPropertyValue<T>(string PropertyName, T value);
        /// <summary>
        /// 调协属性值
        /// </summary>
        /// <param name="iPropertyInfo"></param>
        /// <param name="value"></param>
        void SetPropertyValue(IPropertyInfo iPropertyInfo, object value);
        /// <summary>
        /// 获取所有数据表
        /// </summary>
        ITableInfo TableInfo { get; }
        /// <summary>
        /// 根据字段名称获取属性信息
        /// </summary>
        /// <param name="FieldName"></param>
        /// <returns></returns>
        IPropertyInfo GetPropertyInfoByFieldName(string FieldName);
        /// <summary>
        /// 根据属性名获取属性
        /// </summary>
        /// <param name="PropertyName"></param>
        /// <returns></returns>
        IPropertyInfo GetPropertyInfoByPropertyName(string PropertyName);
        /// <summary>
        /// 获取主键属性
        /// </summary>
        /// <returns></returns>
        IPropertyInfo GetPrimaryPropertyInfo();
        /// <summary>
        /// 获取联合主键属性
        /// </summary>
        /// <returns></returns>
        IList<IPropertyInfo> GetUnionPropertyInfo();
    }
}
